<html>
<head>
<title></title>
<link href="../css/index.css" rel="stylesheet" />
<link href="../easyui/themes/default/easyui.css" rel="stylesheet"
	type="text/css" />
<link href="../easyui/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="../css/demo.css" rel="stylesheet" />
<script src="../easyui/jquery.min.js" type="text/javascript"></script>
<script src="../easyui/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../js/Default.js" type="text/javascript"></script>

</head>
<body class="easyui-layout" style="overflow-y: hidden" scroll="no">
	<noscript>
		<div
			style="position: absolute; z-index: 100000; height: 2046px; top: 0px; left: 0px; width: 100%; background: white; text-align: center;">
			<img src="../images/noscript.gif" alt='抱歉，请开启脚本支持！' />
		</div>
	</noscript>
	<div data-options="region:'north',border:true"
		style="overflow: hidden; height: 70px; background: #338FCC; padding: 10px;">
		<div
			style="color: #fff; font-size: 3em; float: left; margin-left: 30px;">
			后台管理系统，欢迎您</div>
		<div
			style="float: right; position: relative; top: 20px; right: 0px; line-height: 40px;">
			<span id="managerinfo">您好, 梁继东</span> &nbsp; <a
				class="easyui-linkbutton" href="/studentmanagement/logout/mgr.do">注销</a>&nbsp;
			<a href="#" class="easyui-linkbutton" onclick="changepwd()">修改密码
			</a>
		</div>
		<script type="text/javascript">
			var username;
			//获取管理员信息显示
			var managerInfo = $("#managerinfo");
			$
					.ajax({
						type : "POST",
						dataType : "json",
						url : "/studentmanagement/login/mgr/mgrinfo.do",
						success : function(data) {
							var status = data.status;
							if (status == 1) {//跳转到主页面
								username = data.username;
								managerInfo.html("您好！  " + data.username);
							} else {
								//跳转到登录页面
								$.messager
										.alert(
												"提示",
												data.message,
												"warning",
												function() {
													window.location.href = "/studentmanagement/login.html";
												});
							}
						},

						error : function() {
							$.messager
									.alert(
											"提示",
											"系统出错返回登录界面",
											"warning",
											function() {
												window.location.href = "/studentmanagement/login.html";
											});
						}
					});
		</script>
	</div>
	<div data-options="region:'south',border:false"
		style="height: 30px; font-size: 12px; color: #fff; background: #338FCC; padding: 5px; text-align: center">
		© 2016 - 系统Test</div>
	<div
		data-options="region:'west',split:true,title:'菜单',collapsible:true"
		style="width: 190px; padding: 5px;">
		<div id="menu" class="easyui-accordion" fit="true">
			<div title="助管信息管理" style="overflow: auto; padding: 10px;"
				iconCls="icon-edit">
				<ul class="easyui-tree">
					<li><a href="#" onclick="addTab('助管名额修改','./danwei.html')">助管名额修改</a>
					</li>
					<li><a href="#"
						onclick="addTab('助管信息管理','./cur_assist_stu.html')">助管信息管理</a></li>
				</ul>
			</div>
			<div title="学院账号管理" style="overflow: auto; padding: 10px;"
				iconCls="icon-edit">
				<ul class="easyui-tree">
					<li><a href="#" onclick="addTab('账号管理','./secondy_user.html')">账号管理</a></li>
					<li><a href="#" href="Product/Default.htm">权限管理</a></li>
				</ul>
			</div>
			<div title="补助信息管理" style="overflow: auto; padding: 10px;"
				iconCls="icon-edit">
				<ul class="easyui-tree">
					<li><a href="#" href="Product/Default.htm">审核管理</a></li>
					<li><a href="#" href="Product/Default.htm">历史补助记录</a></li>
				</ul>
			</div>
		</div>
	</div>
	<div region="center" id="mainPanle"
		style="overflow: hidden; padding: 2px;">
		<div id="tabs" class="easyui-tabs" fit="true" border="true">
			<div title="主页" style="padding: 20px;" id="home">
				<h1>欢迎...</h1>
			</div>
		</div>
	</div>

	<div id="dd" title="密码修改" style="width: 400px; height: 200px;">
		<table>
			<tr>
				<td>账 号:</td>
				<td><span id="pwd_username"></span></td>
			</tr>
			<tr>
				<td>旧密码:</td>
				<td><input id="old_pwd" type="password" /></td>
			</tr>
			<tr>
				<td>新密码:</td>
				<td><input id="new_pwd" type="password" /></td>
			</tr>
		</table>
	</div>
</body>
<script type="text/javascript">
	function changepwd() {
		//将用户名填上
		$("#pwd_username").html(username);
		$("#dd").dialog({
			modal : true,
			buttons : [ {
				text : '提交',
				iconCls : 'icon-ok',
				handler : putNewPwd
			} ]
		});
	}
	function putNewPwd() {
		//获取用户名，旧密码，新密码
		var old_pwd = $("#old_pwd").val();
		var new_pwd = $("#new_pwd").val();
		//alert(username + "," + old_pwd + "," + new_pwd);
		// 发出一个请求
		$.ajax({
			url : "/studentmanagement/login/mgr/changepwd.do",
			cache : false,
			async : false,
			type : "POST",
			dataType : "json",
			data : {
				username : username,
				password : old_pwd,
				newPwd : new_pwd
			},
			success : function(result) {
				var status = result.status;
				if (status == 1) {
					$.messager.alert("提示", result.message, "info");
					$("#old_pwd").val("");
					$("#new_pwd").val("");
				} else {
					$.messager.alert("提示", result.message, "warning");
				}
			},
			error : function() {
				$.messager.alert("提示", "系统出错,请重试", "warning");
			}
		});
	}
</script>
</html>